
<!--赛事直播开始-->
<?php
$week_array = ['日', '一', '二', '三', '四', '五', '六'];

$time_=time();
for($i=0;$i<2;$i++){
    if($i == 0){
        $time=$time_;
        $newstime_select = date('Y-m-d H:i:s', $time-8400);    // 2小时20分钟=8400秒
        $newstime_end = date('Y-m-d 23:59:59', $time);
        $week = date('w');
    }else{
        $time=strtotime(date('Y-m-d 00:00:00', $time_+$i*24*3600));
        $newstime_select = date('Y-m-d H:i:s', $time);
        $newstime_end = date('Y-m-d 23:59:59', $time);
        $week = date('w', $time);
    }

    $j=0;
    $data = array();
    $sql="select * from {$dbtbpre}ecms_zb where livetime>'$newstime_select' and livetime<'$newstime_end' order by istop DESC,livetime ASC  limit 40";
    $key_sql=$empire->query($sql);
    while($r=$empire->fetch($key_sql)){
        $data[$j] = $r;
        $j++;
    }
    ?>

<div class="match_time"><img src="/skin/style/ico_rili.png"><?=date('Y-m-d', $time)?> 周<?=$week_array[$week]?></div>

    <?php
    $k = 0;
    foreach($data as $data_v){
        $k++;

        $livetime = strtotime($data_v[livetime]);
        if($time<$livetime){
            $liver = '即将开始';
            $sq    = '#0778b8';
            $tq    = '';
        }elseif($time>$livetime && $time<$livetime+8400){
            $liver = '高清直播';
            $sq    = 'red';
            $tq   = 'start';
        }else{
            $liver = '已结束';
            $sq    = 'none';
            $tq    = 'end';
        }

        $lslj='';
        if($data_v[classid]==1){
            $ls='/zuqiu';
        }else{
            $ls='/lanqiu';
        }
        if($data_v[lspy]){
            $lslj = $ls.'/'.$data_v[lspy]; // 联赛链接
        }
        ?>



        <div class="match_zhibo_list match_box">
            <div class="match-item">
                <div class="info_left">
                    <sapn class="time"><?=date('H:i',$livetime)?><em><?=date('m-d',$livetime)?></em></sapn>
                    <sapn class="league"><a target="_blank"><?=$data_v[liansai]?></a></sapn>
                </div>
                <div class="info_center">
                    <div class="home">
                        <div class="left"> <img class="lazy" src="/img/zuqiu.png" data-original="<?=$data_v[zdimg]?>" alt=""> <span class="text"><a><?=$data_v[zd]?></a></span> </div>
                    </div>
                    <div class="score"> <span class="hscore" id="zd_4171431">0</span> <span class="fenge">-</span> <span class="vscor" id="kd_4171431">0</span> </div>
                    <div class="away">
                        <div class="right"> <img class="lazy" src="/img/zuqiu.png" data-original="<?=$data_v[kdimg]?>" alt="<?=$data_v[kd]?>">  <span class="text"><a><?=$data_v[kd]?></a></span> </div>
                    </div>
                </div>
                <div class="info_right <?=$tq?>"> <a href="<?=$data_v[titleurl]?>" target="_blank"><?=$liver?></a> </div>
            </div>
        </div>




        <?php
    }
}
?>






<div class="ty-match ty-el-mg-t-15">
    <div class="ty-match__item">


        <?php
        $week_array = ['日', '一', '二', '三', '四', '五', '六'];

        $time_=time();
        for($i=0;$i<2;$i++){
            if($i == 0){
                $time=$time_;
                $newstime_select = date('Y-m-d H:i:s', $time-8400);    // 2小时20分钟=8400秒
                $newstime_end = date('Y-m-d 23:59:59', $time);
                $week = date('w');
            }else{
                $time=strtotime(date('Y-m-d 00:00:00', $time_+$i*24*3600));
                $newstime_select = date('Y-m-d H:i:s', $time);
                $newstime_end = date('Y-m-d 23:59:59', $time);
                $week = date('w', $time);
            }

            $j=0;
            $data = array();
            $sql="select * from {$dbtbpre}ecms_zb where livetime>'$newstime_select' and livetime<'$newstime_end' order by istop DESC,livetime ASC  limit 30";
            $key_sql=$empire->query($sql);
            while($r=$empire->fetch($key_sql)){
                $data[$j] = $r;
                $j++;
            }
            ?>

            <h3 class="ty-match__date"><?=date('Y-m-d', $time)?> 周<?=$week_array[$week]?></h3>

            <ul class="ty-match__content">
                <?php
                $k = 0;
                foreach($data as $data_v){
                    $k++;

                    $livetime = strtotime($data_v[livetime]);
                    if($time<$livetime){
                        $liver = '即将开始';
                        $sq    = '#0778b8';
                        $tq    = '';
                    }elseif($time>$livetime && $time<$livetime+8400){
                        $liver = '高清直播';
                        $sq    = 'red';
                        $tq   = 'start';
                    }else{
                        $liver = '已结束';
                        $sq    = 'none';
                        $tq    = 'end';
                    }

                    $lslj='';
                    if($data_v[classid]==1){
                        $ls='/zuqiu';
                    }else{
                        $ls='/lanqiu';
                    }
                    if($data_v[lspy]){
                        $lslj = $ls.'/'.$data_v[lspy]; // 联赛链接
                    }
                    ?>

                    <?
                    if($bqr[classid]==1){
                        $clurl='zuqiu';
                    }else{
                        $clurl='lanqiu';
                    }
                    if ($bqr[isgood]==0){
                        $clss="0";
                    }else {
                        $clss = '1';
                    }
                    ?>
                    <li class="ty-match__item-list">
                        <div class="ty-match__time"><?=date('H:i',$livetime)?></div>
                        <div class="ty-match__label ty-el-text-overflow-1">
                            <a href="<?=$data_v[titleurl]?>" target="_blank"><?=$data_v[liansai]?></a>
                        </div>
                        <div class="ty-match__team">
                            <span class="ty-match__home-team ty-el-text-overflow-1"><?=$data_v[zd]?></span>
                            <img class="ty-match__team-icon ty-el-mg-l-5 lazy" alt="" src="/img/zuqiu.png" data-original="<?=$data_v[zdimg]?>">
                            <span class="ty-match__vs">VS</span>
                            <img class="ty-match__team-icon lazy" alt="" src="/img/zuqiu.png" data-original="<?=$data_v[kdimg]?>">
                            <span class="ty-match__visitor-team ty-el-text-overflow-1 ty-el-mg-l-5"><?=$data_v[kd]?></span>
                        </div>

                        <div class="ty-match__play-btn ty-el-flex ty-el-align-items-center">
                            <span class="ty-match__play-icon"></span>
                            <a class="ty-match__play-btn-name" href="<?=$data_v[titleurl]?>" target="_blank"><?=$liver?></a>
                        </div>
                    </li>
                    <?php
                }
                ?>
            </ul>
            <?php
        }
        ?>








        <div class="panel">


            <?php
            $week_array = ['日', '一', '二', '三', '四', '五', '六'];

            $time_=time();
            for($i=0;$i<2;$i++){
                if($i == 0){
                    $time=$time_;
                    $newstime_select = date('Y-m-d H:i:s', $time-8400);    // 2小时20分钟=8400秒
                    $newstime_end = date('Y-m-d 23:59:59', $time);
                    $week = date('w');
                }else{
                    $time=strtotime(date('Y-m-d 00:00:00', $time_+$i*24*3600));
                    $newstime_select = date('Y-m-d H:i:s', $time);
                    $newstime_end = date('Y-m-d 23:59:59', $time);
                    $week = date('w', $time);
                }

                $j=0;
                $data = array();
                $sql="select * from {$dbtbpre}ecms_zb where livetime>'$newstime_select' and livetime<'$newstime_end' order by istop DESC,livetime ASC  limit 30";
                $key_sql=$empire->query($sql);
                while($r=$empire->fetch($key_sql)){
                    $data[$j] = $r;
                    $j++;
                }
                ?>
                <div class="panel-hd">
                    <span class="hdt"><?=date('Y-m-d', $time)?> 周<?=$week_array[$week]?> &nbsp;&nbsp;联赛直播列表</span>
                    <a class="zhedie-zhankai zhedie" href="javascript:void(0);">
                        <img src="/skin/style/zhedie.png" alt="折叠" title="折叠">
                    </a>
                </div>
                <ul class="panel-bd zb-list">
                    <?php
                    $k = 0;
                    foreach($data as $data_v){
                        $k++;

                        $livetime = strtotime($data_v[livetime]);
                        if($time<$livetime){
                            $liver = '即将开始';
                            $sq    = '#0778b8';
                            $tq    = '';
                        }elseif($time>$livetime && $time<$livetime+8400){
                            $liver = '高清直播';
                            $sq    = 'red';
                            $tq   = 'start';
                        }else{
                            $liver = '已结束';
                            $sq    = 'none';
                            $tq    = 'end';
                        }

                        $lslj='';
                        if($data_v[classid]==1){
                            $ls='/zuqiu';
                        }else{
                            $ls='/lanqiu';
                        }
                        if($data_v[lspy]){
                            $lslj = $ls.'/'.$data_v[lspy]; // 联赛链接
                        }
                        ?>
                        <li class="zb-info">
                            <div>
                                <img class="zb-icon lazy" src="/skin/style/zuqiu.png" data-original="/static/image/zuqiu.png" alt="" style="display: block;">
                                <p class="zb-time"><?=date('H:i',$livetime)?></p>
                                <p class="zb-type">
                                    <a  title="<?=$data_v[liansai]?>" href="<?=$data_v[titleurl]?>" target="_blank"><?=$data_v[liansai]?></a>
                                </p>
                            </div>
                            <div class="zb-qiudui">
                                <span class="hteam"><?=$data_v[zd]?><img class="lazy" src="/img/zuqiu.png" data-original="<?=$data_v[zdimg]?>" alt="<?=$data_v[zd]?>" style="display: inline-block;"></span>
                                <div class="bf">
                                    <p>VS</p>
                                </div>
                                <span class="vteam"><img class="lazy" src="/img/zuqiu.png" data-original="<?=$data_v[kdimg]?>" alt="<?=$data_v[kd]?>" style="display: inline-block;"><?=$data_v[kd]?></span>
                            </div>
                            <p class="zb-area">
                                <a  class="zb-area_btn start" href="<?=$data_v[titleurl]?>"><span class="live"><?=$liver?></span></a>
                            </p>
                        </li>
                        <?php
                    }
                    ?>
                </ul>
                <?php
            }
            ?>





            <div class="ty-main-left">

                <div class="ty-match ty-el-mg-t-15">
                    <?php
                    $week_array = ['日', '一', '二', '三', '四', '五', '六'];

                    $time_=time();
                    for($i=0;$i<2;$i++){
                    if($i == 0){
                        $time=$time_;
                        $newstime_select = date('Y-m-d H:i:s', $time-8400);    // 2小时20分钟=8400秒
                        $newstime_end = date('Y-m-d 23:59:59', $time);
                        $week = date('w');
                    }else{
                        $time=strtotime(date('Y-m-d 00:00:00', $time_+$i*24*3600));
                        $newstime_select = date('Y-m-d H:i:s', $time);
                        $newstime_end = date('Y-m-d 23:59:59', $time);
                        $week = date('w', $time);
                    }

                    $j=0;
                    $data = array();
                    $sql="select * from {$dbtbpre}ecms_zb where livetime>'$newstime_select' and livetime<'$newstime_end' order by istop DESC,livetime ASC  limit 30";
                    $key_sql=$empire->query($sql);
                    while($r=$empire->fetch($key_sql)){
                        $data[$j] = $r;
                        $j++;
                    }
                    ?>

                    <div class="ty-match__item">
                        <h3 class="ty-match__date"><?=date('Y-m-d', $time)?> 周<?=$week_array[$week]?></h3>

                        <ul class="ty-match__content">
                            <?php
                            $k = 0;
                            foreach($data as $data_v){
                                $k++;

                                $livetime = strtotime($data_v[livetime]);
                                if($time<$livetime){
                                    $liver = '即将开始';
                                    $sq    = '#0778b8';
                                    $tq    = '';
                                }elseif($time>$livetime && $time<$livetime+8400){
                                    $liver = '高清直播';
                                    $sq    = 'red';
                                    $tq   = 'start';
                                }else{
                                    $liver = '已结束';
                                    $sq    = 'none';
                                    $tq    = 'end';
                                }

                                $lslj='';
                                if($data_v[classid]==1){
                                    $ls='/zuqiu';
                                }else{
                                    $ls='/lanqiu';
                                }
                                if($data_v[lspy]){
                                    $lslj = $ls.'/'.$data_v[lspy]; // 联赛链接
                                }
                                ?>
                                <?

                                if($bqr[classid]==1){
                                    $clurl='zuqiu';
                                }else{
                                    $clurl='lanqiu';
                                }

                                if ($bqr[isgood]==0){
                                    $clss="0";
                                }else {
                                    $clss = '1';
                                }
                                ?>
                                <li class="ty-match__item-list">
                                    <div class="ty-match__time"><?=date('H:i',$livetime)?></div>
                                    <div class="ty-match__label ty-el-text-overflow-1">
                                        <a href="<?=$data_v[titleurl]?>" target="_blank"><?=$data_v[liansai]?></a>
                                    </div>
                                    <div class="ty-match__team">
                                        <span class="ty-match__home-team ty-el-text-overflow-1"><?=$data_v[zd]?></span>
                                        <img class="ty-match__team-icon ty-el-mg-l-5 lazy" alt="" src="/img/zuqiu.png" data-original="<?=$data_v[zdimg]?>">
                                        <span class="ty-match__vs">VS</span>
                                        <img class="ty-match__team-icon lazy" alt=""src="/img/zuqiu.png" data-original="<?=$data_v[kdimg]?>">
                                        <span class="ty-match__visitor-team ty-el-text-overflow-1 ty-el-mg-l-5"><?=$data_v[kd]?></span>
                                    </div>

                                    <div class="ty-match__play-btn ty-el-flex ty-el-align-items-center">
                                        <span class="ty-match__play-icon"></span>
                                        <a class="ty-match__play-btn-name" href="<?=$data_v[titleurl]?>" target="_blank"><?=$liver?></a>
                                    </div>
                                </li>

                                <?php

                            }
                            ?>
                        </ul>

                        <?php

                        }
                        ?>
                    </div>













































